import React, { Component } from 'react'
import {HashRouter,Route,Routes,Navigate,Link} from 'react-router-dom'
import Login from "./views/Login/Login"
import Home from "./views/Home/Home"
import CinemalDetail from "./views/CinemalDetail/CinemalDetail"
import Seat from "./views/Seat/Seat"
// 二级路由
import Cinemal from "./views/Home/Home-modules/Cinemal/Cinemal"
import My from "./views/Home/Home-modules/My/My"
import Movie from "./views/Home/Home-modules/Movie/Movie"


export default class App extends Component {
  render() {
    return (
      <div>
        {/* 路由容器 */}
      

    
          {/* 根据地址决定渲染那个组件 */}
          
        <Routes >
          <Route path='/' element={<Navigate to={"/home"}></Navigate>}></Route>
          <Route path='/login'  element={<Login></Login>}> </Route>
          <Route path='/home' element={<Home></Home>}>
            {/* 二级路由 */}
            {/* 重定向 */}
            <Route path='/home' element={<Navigate to={"/home/movie"}></Navigate>}></Route>
            <Route path='movie' element={<Movie></Movie>}></Route>
            <Route path='my' element={<My></My>}></Route>
            <Route path='cinemal' element={<Cinemal></Cinemal>}></Route>
          </Route>
          <Route path='/cinemalDetail' element={<CinemalDetail></CinemalDetail>}></Route>
          <Route path='/seat' element={<Seat></Seat>}></Route>
          <Route path='*' element={<h1>404</h1>}></Route>
        </Routes>
      
      </div>
    )
  }
}

